<template>
	<view class="xp24-32">
		<u-parse :content="info.content"></u-parse>
	</view>
</template>

<script setup>
	import {indexcontent,problemdetail,supportdetail} from '../../../network/home.js'
	import {
		onReachBottom,
		onShow,
		onLoad,
		onPullDownRefresh
	} from '@dcloudio/uni-app';
	import {
		reactive,
		ref,
		computed
	} from 'vue';
	
	onLoad((Option)=>{
		
		if(Option.type == '1'){
			info.id = Option.id
			
			getdetail()
			return
		}
		
		if(Option.type == '2'){
			info.id = Option.id
			getsupportdetail()
			return
		}
		uni.setNavigationBarTitle({
			title:Option.title
		})
		info.name = Option.name
		getindexcontent()
	})
	let info = reactive({
		name:'',
		content:'',
		id:''
	})
	const getindexcontent = () =>{
		indexcontent({name:info.name}).then(res=>{
			info.content = res.data
		})
	}
	
	const getdetail = () =>{
		
		problemdetail({
			id:info.id
		}).then(res=>{
			info.content = res.data.content
			uni.setNavigationBarTitle({
				title: res.data.title
			})
		})
	}
	
	// 帮助支持
	const getsupportdetail = () =>{
		supportdetail({
			id:info.id
		}).then(res=>{
			info.content = res.data.content
			uni.setNavigationBarTitle({
				title: res.data.title
			})
		})
	}
</script>

<style>

</style>
